import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import 'normalize.css/normalize.css'
import { get, post } from "./uilt/http";
import axios from 'axios';
Vue.prototype.$axios = axios

// 添加拦截器
axios.interceptors.request.use(
  config=>{
    let tk = sessionStorage.getItem("token");
    config.headers.Authorization = tk
    return config;
  },
  error=>{
    console.log("请求错误");
    return Promise.reject(error)
  },
)
Vue.use(ElementUI);

Vue.prototype.$http = {
   get,
   post
};
Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')